package lk.icta.common.dao;

import lk.icta.common.entity.Person;
import lk.icta.user.entity.User;

import java.util.List;

/**
 * @author Duminda Dharmakeerthi
 */
public interface PersonDAO {
    /**
     * Add a Person
     *
     * @param person
     * @param user
     */
    public void addPerson(Person person, User user);

    /**
     * Find a person by id
     *
     * @param personId
     * @param user
     * @return Person corresponding to the given id
     */
    public Person getPersonById(long personId, User user);

    /**
     * Find a person by name
     *
     * @param name
     * @param user
     * @return List of people who has the given name
     */
    public List<Person> getPersonByName(String name, User user);

    /**
     * Find a person by NIC
     *
     * @param nic
     * @param user
     * @return Person corresponding to the given NIC
     */
    public Person getPersonByNIC(String nic, User user);

    /**
     * Update a person
     *
     * @param person
     * @param user
     */
    public void updatePerson(Person person, User user);

    /**
     * Return all Persons
     *
     * @return all Persons
     */
    public List<Person> findAll();
}
